package com.tarry.io.serialization;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;

public class SerializableDemo {
    public static void main(String[] args) throws Exception{
        Book book = Book.builder().bookName("Java book").author("tarry").dec("程序").build();
        ObjectOutputStream outputStream = new ObjectOutputStream(Files.newOutputStream(Paths.get("./book.text")));
        outputStream.writeObject(book);
        outputStream.close();
    }
}
